<template>
  <j-modal
    :title="title"
    :width="1200"
    :visible="visible"
    :maskClosable="false"
    switchFullscreen
    @ok="handleOk"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handleCancel">

    <hf-pm-project-select-list ref="hfPmProjectSelectList" :multiple="this.multiple"/>
  </j-modal>
</template>

<script>
  import HfPmProjectSelectList from './HfPmProjectSelectList'

  export default {
    name: 'HfProjectSelectModal',
    components: {
      HfPmProjectSelectList
    },
    props: {
      multiple:{
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        title: '',
        width: 800,
        visible: false,
        disableSubmit: false
      }
    },
    methods: {
      close () {
        this.$emit('close');
        this.visible = false;
      },
      handleCancel () {
        this.close()
      },
      handleOk() {
        let data = this.$refs.hfPmProjectSelectList.selectionRows[0]
        this.$emit('hf-pm-project-select', data)
        this.close()
      }
    }
  }
</script>

<style scoped>

</style>